/*
 * @Author: Zhang Yingying
 * @Date: 2020-11-08 20:23:35
 * @LastEditors: Zhang Yingying
 * @LastEditTime: 2020-11-29 23:49:40
 */

import { roleMap } from '@/config/business'

export function useProduct() {
  function renderProductState(state) {
    return !!state ? '上架中' : '已下架'
  }
  return {
    renderProductState,
  }
}

export var RenderMixin = {
  filters: {
    renderRole(roleId) {
      var role = roleMap[roleId] || {}
      return role.label
    },
  },
  methods: {
    renderRole(roleId) {
      var role = roleMap[roleId] || {}
      return role.label
    },
  },
}
